<template>
	<view class="page">
		<view class="main">
			<view class="lists-wrap">
				<view class="lists" v-for="(i,index) in lists" :key="index">
					<!-- <image class="icon" src="../../../static/img/integral-icon.png"></image> -->
					<view class="content">
						<view class="name-wrap flexACB">
							<view class="label">
								{{i.content}}
							</view>
						</view>
						<view class="desc-wrap flexACB">
							<view class="tiem">
								{{i.createTime}}
							</view>
							<view class="shou">
								{{i.type==='1'?'跟进记录':'操作记录'}}
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageIndex: 1,
				lists: [],
				id: ''
			};
		},
		onLoad(o) {
			this.id = o.id
			this.getList()
		},
		onReachBottom() {
			++this.pageIndex
			this.getList()
		},
		methods: {
			getList() {
				this.$api.custom.getCustomNoteList({
					pageIndex: this.pageIndex,
					customId: this.id
				}).then(res => {
					if (res.rows.length > 0) {
						this.lists = this.lists.concat(res.rows)
					} else {
						--this.pageIndex
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		background-color: #F5F5F5;
		min-height: 100vh;

		.tabs-wrap {
			background-color: #fff;
			height: 96rpx;
			display: flex;

			.tabs {
				height: 100%;
				flex: 1;
				text-align: center;
				font-size: 32rpx;
				font-weight: bold;
				position: relative;
				line-height: 96rpx;

				&.active {
					&::after {
						content: '';
						position: absolute;
						bottom: 12rpx;
						width: 36rpx;
						height: 6rpx;
						background: #EC2424;
						border-radius: 3rpx;
						left: 50%;
						transform: translateX(-50%);
					}

				}
			}
		}

		.main {
			position: relative;
			padding: 24rpx 30rpx;
		}
	}

	.lists-wrap {
		width: 100%;
		box-shadow: 0px 4rpx 20rpx 0px rgba(75, 74, 85, 0.02);
		border-radius: 16rpx;
		padding: 0 26rpx 0 20rpx;
		background-color: #ffffff;
	}

	.lists {
		width: 100%;
		padding: 24rpx 0 20rpx;
		border-bottom: 1px solid #EBEBEB;
		display: flex;

		&:last-child {
			border-bottom: 1px solid transparent;
		}

		.icon {
			width: 68rpx;
			height: 68rpx;
			flex-shrink: 0;
		}

		.content {
			flex: 1;
			padding-left: 24rpx;

			.name-wrap {
				width: 100%;
				margin-bottom: 8rpx;

				.label {
					font-size: 30rpx;
				}

				.scope {
					font-size: 30rpx;
					font-weight: bold;
				}
			}

			.desc-wrap {
				width: 100%;

				.tiem {
					color: #AAAAAA;
				}

				.yong {
					color: #FFB14D;
				}

				.shou {
					color: #DB1A22;
				}
			}
		}

	}
</style>